package com.itheima.tlias.web.controller;

import com.itheima.tlias.anno.LogAnno;
import com.itheima.tlias.service.DeptService;
import com.itheima.tlias.vo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ghy
 * @version 1.0.1
 * @date 2024-01-28 09:42:49
 */
@RestController
@RequestMapping("/depts")
@Slf4j
public class DeptController {

    @Autowired
    private DeptService deptService;

    /**
     * 查询所有
     * @return
     */
    @GetMapping
    @LogAnno(methodDesc = "查询所有部门")
    public Result findAll(){
        log.info("DeptController findAll");
        return deptService.findAll();
    }

}
